
// const { Sequelize, DataTypes } = require("sequelize");
const { STRING, INTEGER } = require('../types')

module.exports = (sequelize) => {
  const article = sequelize.define(
    'article',
    {// 在这里定义模型属性
      article_id: {
        type: INTEGER,
        primaryKey: true, // 主键
        autoIncrement: true, // 自增
        allowNull: false // 允许空 不给这个属性默认表述允许
      },
      article_title: {
        type: STRING,
      },
      article_img: {
        type: STRING,
      },
      article_content: {
        type: STRING,
      }
    }, 
    {
    tableName: "article",//直接提供表名
    timestamps: false
   }
  );
  return article
}
